package com.aierkeji.call.cms.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.aierkeji.call.cms.entity.contants.ApprovalResult;
import com.aierkeji.call.cms.entity.snap.AkjCallUserSnap;

/**
 * 审批历史表
 * 
 * @author Aaron
 *
 */

@Entity
@Table(name = "Akj_call_approval_histroy")
public class AkjCallApprovalHistro {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", length = 32)
	private Long id;
	
	
	@ManyToOne(targetEntity = AkjCallUserSnap.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "apply_user_id", nullable = true)
	@NotFound(action = NotFoundAction.IGNORE)
	private AkjCallUserSnap applyUserId;
	
	@ManyToOne(targetEntity = AkjCallUserSnap.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "approval_user_id", nullable = true)
	@NotFound(action = NotFoundAction.IGNORE)
	private AkjCallUserSnap approvalUserId;
	
	@Column(length = 1)
	@Enumerated(EnumType.STRING)
	private ApprovalResult approvalResult;
	
	@Column(length = 300)
	private String remark;
	
	@Column(columnDefinition = "datetime")
	private Date applyAt;
	
	@Column(columnDefinition = "datetime")
	private Date approvalAt;
	
	@Column(name = "is_delete", nullable = false)
	private boolean isDelete = false;

	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	
	public AkjCallUserSnap getApplyUserId() {
		return applyUserId;
	}

	public void setApplyUserId(AkjCallUserSnap applyUserId) {
		this.applyUserId = applyUserId;
	}

	public AkjCallUserSnap getApprovalUserId() {
		return approvalUserId;
	}

	public void setApprovalUserId(AkjCallUserSnap approvalUserId) {
		this.approvalUserId = approvalUserId;
	}

	public ApprovalResult getApprovalResult() {
		return approvalResult;
	}

	public void setApprovalResult(ApprovalResult approvalResult) {
		this.approvalResult = approvalResult;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getApplyAt() {
		return applyAt;
	}

	public void setApplyAt(Date applyAt) {
		this.applyAt = applyAt;
	}

	public Date getApprovalAt() {
		return approvalAt;
	}

	public void setApprovalAt(Date approvalAt) {
		this.approvalAt = approvalAt;
	}

	
	
}
